#ifndef GZIP_H__
#define GZIP_H__

#include "zlib/zlib.h"

int inflate_read(const char *source,int len,char **dest,int *destlen,bool gzip);
int deflate_write(const char* raw,int len,char** compressbuf,int *destlen);

bool MakeGZFile(const char* szPath,const char* pBuf,int nLen);
bool MakeGZBuffer(const char* pSourceBuf,int nSourceLen,char** pDestBuf,int* nDestLen);


class CGZipCreator
{
public:
	CGZipCreator();
	~CGZipCreator();
	bool Init(const CString& strFilePath);
	int GetGZipBuffer(byte* pBuf,int nLen);
protected:
private:
	z_stream* m_strm;
	CFile* m_File;
	int m_nTotalRead;
};

#endif